package com.zl.controller;

import com.zl.pojo.News;
import com.zl.service.NewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/index")
public class IndexController {
    @Autowired
    private NewsService ns;
    @RequestMapping("/news")
    public String index(Map<String,Object> args) {
        //System.out.println("高手，一定是高手");
        List<News> news =new ArrayList<>();
        news=ns.queryNews();
        args.put("news",news);
        return "index/Index";
    }
}
